import { defineComponent } from "vue";
import PageTitle from "@/components/PageTitle";
import Form from "@/components/Form";
import { IFormItem } from "@/components/Form/types";
import { useRequest } from "./request";
export default defineComponent({
  name: "",
  setup() {
    const { personInfo } = useRequest();
    const data: IFormItem[] = [
      {
        type: "usericonupload",
        label: "头像",
        key: "logo",
      },
      {
        type: "input",
        label: "姓名",
        key: "name",
      },
      {
        type: "input",
        label: "手机号",
        key: "phone",
        readonly: true,
      },
      {
        type: "select",
        label: "性别",
        key: "sex",
        typeData: [
          {
            label: "男",
            value: "0",
          },
          {
            label: "女",
            value: "1",
          },
        ],
      },
      // {
      //   type: "select",
      //   label: "民族",
      //   key: "xb",
      //   typeData: [
      //     {
      //       label: "汉",
      //       value: "1",
      //     },
      //   ],
      // },
      {
        type: "input",
        label: "实名认证",
        key: "smFlag",
        readonly: true,
      },
      {
        type: "input",
        label: "用户ID",
        key: "id",
        readonly: true,
      },
      {
        type: "input",
        label: "我的地址",
        key: "address",
      },
    ];
    return () => {
      return (
        <PageTitle title="个人信息修改" childClass="!p-0">
          <Form class={"!px-15"} data={data} modelValue={personInfo} />
        </PageTitle>
      );
    };
  },
});
